import { PatientList, PatientParams } from '../types/patient'
import { request } from '../utils/request'
//获取患者列表
export const getPatientApi = () => {
	return request.get<null, PatientList[]>('/patient/mylist')
}

//添加患者
export const addPatientApi = (data: PatientParams) => {
	return request.post('/patient/add', data)
}
//删除患者
export const deletePatientApi = (id: string) => {
	return request.delete(`/patient/del/${id}`)
}
/**
 * 患者详情（家庭档案）
 */
export const patientDetailApi = (id: string) => {
	return request.get<null, PatientParams>(`/patient/info/${id}`)
}
/**
 * 编辑（更新）患者（家庭档案）
 */
export const updatePatientApi = (data: PatientParams) => {
	return request.put(`/patient/update`, data)
}